<template>
	<view>
		<text>通讯录</text>
		<view class="my-state">vuex的store存储的用户名---{{userName}}</view>
		<view class="my-box">
			<button @click="login('蜡笔小新')">登录</button>
			<button @click="logout()">退出</button>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from 'vuex';
	
	export default {
		data() {
			return {
				
			}
		},
		onPullDownRefresh() {
			console.log('页面下拉刷新成功')
		},
		computed: {
			...mapState(['userName'])
		},
		methods: {
			...mapActions(['login','logout'])
		}
	}
</script>

<style>

</style>
